package dao.Impl;


import dao.TuserDao;
import pojo.Tuser;
import util.BaseDao;

import java.util.ArrayList;
import java.util.List;

public class TuserDaoImpl extends BaseDao implements TuserDao {
    @Override
    public Tuser login(String username, String pwd) {
        String sql = "select * from t_user where account = ? and password = ?";
        rs = exeQ(sql, username, pwd);
        Tuser ts = null;
        try {
            if (rs.next()){
                ts=new Tuser(rs.getInt(1),
                        rs.getString(2),
                        rs.getString(3),
                        rs.getString(4),
                        rs.getInt(5),
                        rs.getString(6),
                        rs.getString(7),
                        rs.getString(8),
                        rs.getInt(9),
                        rs.getString(10));
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return ts;
    }


}
